package com.genexususa.eo.bing.data.wsSubclasses;

import com.genexususa.eo.bing.CampaignManagementServiceClasses.SiteLink;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public class GxSiteLink extends SiteLink {
    public GxSiteLink(Element element) {
        if (element.getElementsByTagName("DestinationUrl").getLength() > 0 &&
            element.getElementsByTagName("DestinationUrl").item(0).getChildNodes().getLength() > 0) {
            this.setDestinationUrl(((Node) element.getElementsByTagName("DestinationUrl").item(0).getChildNodes().item(0)).getNodeValue());
        }
        if (element.getElementsByTagName("DisplayText").getLength() > 0 &&
            element.getElementsByTagName("DisplayText").item(0).getChildNodes().getLength() > 0) {
            this.setDisplayText(((Node) element.getElementsByTagName("DisplayText").item(0).getChildNodes().item(0)).getNodeValue());
        }
    }
}
